﻿using System;
using System.Collections.Generic;

using E.BLL;
using E.Model;
using E.Web.UI.Page;
using E.Enum;

using X.Common;

namespace E.Web.Teacher.internals.publics.exam
{
    public partial class View : TeacherBasePage
    {
        public int id;
        public int cid;
        public ExamInfoModel model = new ExamInfoModel();
        public IList<DictAreaModel> areaList;
        public IList<ExamSettingModel> settingList;
        public string certificateName = "";

        public string area_v;

        protected override void ShowPage()
        {
            id = XRequest.GetInt("id", -1);
            cid = XRequest.GetInt("cid", -1);

            if (id != -1)
            {
                EnumExamCategory categoryid = (EnumExamCategory)cid;
                ExamBLL bll = new ExamBLL();
                model = bll.GetExamInfo(id, categoryid);

                settingList = bll.GetExamQuestionSetting(id);

                areaList = GetTeacherAreaList(teacherid);
                area_v = Convert2String(model.AreaList);

                switch (model.CategoryID)
                {
                    case EnumExamCategory.CourseExam:
                        certificateName = (new CourseBLL()).GetCertificateNameByID(model.CertificateID);
                        break;
                    default:
                        break;
                }
            }
            else
            {
                ExecuteJS("alert('服务器忙，请稍后再试'); window.location = '/internals/publics/exam/List.aspx';");
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
